/**
 * @description: 默认路由
 * @file: routes.ts
 * @author: Evan
 * @date: 2025.07.14 14:00:34
 * @week: 周一
 * @version: V
 */

import { exportPagesRoutesConfig } from './utils'
import layout from '@/layout/index.vue'

// 固定显示路由 不受权限控制
export const constantRoutes = [
  {
    path: '/login',
    name: 'login',
    meta: { title: '登录', mult: 'login', hidden: true },
    component: () => import('@/views/login/index.vue')
  },
  {
    path: '/error',
    name: 'error',
    component: () => import('@/layout/404/index.vue')
  },
  {
    path: '/redirect',
    component: layout,
    children: [
      {
        path: '/redirect/:path*',
        name: 'redirect',
        component: () => import('@/layout/redirect/index.vue')
      }
    ]
  },
  {
    path: '/',
    component: layout,
    redirect: '/home',
    children: [
      {
        path: 'home',
        component: () => import('@/layout/home.vue'),
        name: 'home',
        meta: { title: '首页', mult: 'home', hidden: true, icon: 'home' }
      }
    ]
  },
  {
    // 错误路由界面
    path: '/:pathMatch(.*)*',
    meta: { title: '管理平台', mult: 'glpt', hidden: true },
    component: () => import('@/layout/404/index.vue')
  }
]

// 动态导出路由配置
const exportAsyncRoutes = exportPagesRoutesConfig()

export const asyncRoutes = [...exportAsyncRoutes]
